package com.wangjiacai.hqlQuery.service.impl;

import com.wangjiacai.hqlQuery.repository.BaseRepository;
import com.wangjiacai.hqlQuery.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Transactional
public class BaseServiceImpl implements BaseService {

    @Autowired
    public BaseRepository baseRepository;

    @Override
    public <T> T get(String hql, Class<T> classType) {
        return baseRepository.get(hql,classType);
    }

    @Override
    public <T> T get(String hql, Map<String, Object> params,Class<T> classType) {
        return baseRepository.get(hql, params,classType);
    }

    @Override
    public <T> T get(String hql, Object object,Class<T> classType) {
        return baseRepository.get(hql, object,classType);
    }

    @Override
    public <T> List<T> find(String hql, Class<T> classType) {
        return baseRepository.find(hql,classType);
    }

    @Override
    public <T> List<T> find(String hql, Map<String, Object> params,Class<T> classType) {
        return baseRepository.find(hql, params,classType);
    }

    @Override
    public <T> List<T> find(String hql, Object object,Class<T> classType) {
        return baseRepository.find(hql, object,classType);
    }

    @Override
    public <T> List<T> find(String hql, Map<String, Object> params, Pageable pageable, Class<T> classType) {
        return baseRepository.find(hql, params, pageable,classType);
    }

    @Override
    public <T> List<T> find(String hql, Object object, Pageable pageable, Class<T> classType) {
        return baseRepository.find(hql, object, pageable,classType);
    }

    @Override
    public <T> List<T> nativeFind(String sql, Class<T> classType) {
        return baseRepository.nativeFind(sql,classType);
    }

    @Override
    public <T> List<T> nativeFind(String sql, Map<String, Object> params, Class<T> classType) {
        return baseRepository.nativeFind(sql,params,classType);
    }

    @Override
    public <T> List<T> nativeFind(String sql, Object object, Class<T> classType) {
        return baseRepository.nativeFind(sql,object,classType);
    }

    @Override
    public <T> List<T> nativeFind(String sql, Map<String, Object> params, Pageable pageable, Class<T> classType) {
        return baseRepository.nativeFind(sql,params,pageable,classType);
    }

    @Override
    public <T> List<T> nativeFind(String sql, Object object, Pageable pageable, Class<T> classType) {
        return baseRepository.nativeFind(sql,object,pageable,classType);
    }

    @Override
    public long count(String hql) {
        return baseRepository.count(hql);
    }

    @Override
    public long count(String hql, Object object) {
        return baseRepository.count(hql, object);
    }

    @Override
    public long count(String hql, Map<String, Object> params) {
        return baseRepository.count(hql, params);
    }

    @Override
    public long nativeCount(String sql, Object object) {
        return baseRepository.nativeCount(sql,object);
    }

    @Override
    public long nativeCount(String sql, Map<String, Object> params) {
        return baseRepository.nativeCount(sql,params);
    }

    @Override
    public long nativeCount(String sql) {
        return baseRepository.nativeCount(sql);
    }

    @Override
    public void execute(String hql) {
        baseRepository.execute(hql);
    }

    @Override
    public void execute(String hql, Object object) {
        baseRepository.execute(hql,object);
    }

    @Override
    public void execute(String hql, Map<String, Object> params) {
        baseRepository.execute(hql,params);
    }

    @Override
    public <T> T save(T t) {
        return baseRepository.save(t);
    }
}
